<?php
/**
 * Created by PhpStorm.
 * User: zhangrxiang
 * Date: 2016/9/26
 * Time: 11:23
 */

$fiveMBs = 5 * 1024 * 1024;
$fp = fopen("php://temp/maxmemory:$fiveMBs", 'r+');

fputs($fp, "hello\n");

// Read what we have written.
rewind($fp);
echo stream_get_contents($fp);

readfile("php://filter/resource=http://www.example.com");
